home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Workbench Add-On
/
Workbench Add-On - Volume 1.iso
/
BBS-Archive
/
Comm
/
term-source.lha
/
Extras
/
Source
/
gtlayout-Source.lha
/
LTP_DrawTapeButton.c
< prev
next >
Wrap
C/C++ Source or Header
|
1995-03-25
|
2KB
|
107 lines
/* GadTools layout toolkit
**
** Copyright © 1993-1995 by Olaf `Olsen' Barthel
** Freely distributable.
*/
#include "gtlayout_global.h"
#ifdef DO_TAPEDECK_KIND
VOID __regargs
LTP_DrawTapeButton(struct RastPort *RPort,ImageInfo *imageInfo,LONG Left,LONG Top,LONG Width,LONG Height,LONG AspectX,LONG AspectY,LONG Background)
{
LONG SizeX,SizeY,Mid,Size;
ImageTypes ImageType;
ImageType = imageInfo -> ImageType;
SizeX = imageInfo -> GlyphWidth;
SizeY = imageInfo -> GlyphHeight;
Left += 6;
Top += 3;
Width -= 2 * 6;
Height -= 2 * 3;
if(!SizeY)
SizeY = Height;
if(!SizeX)
{
SizeX = (SizeY * AspectY) / AspectX;
if(ImageType == IMAGECLASS_BACKWARD || ImageType == IMAGECLASS_FORWARD)
SizeX *= 2;
}
if(SizeX > 0 && SizeY > 0)
{
switch(ImageType)
{
case IMAGECLASS_BACKWARD:
case IMAGECLASS_FORWARD:
Left = Left + (Width - SizeX) / 2;
Top = Top + (Height - SizeY) / 2;
LTP_DrawBackFore(RPort,ImageType == IMAGECLASS_BACKWARD,Left,Top,SizeX,SizeY);
break;
case IMAGECLASS_PREVIOUS:
case IMAGECLASS_NEXT:
Left = Left + (Width - SizeX) / 2;
Top = Top + (Height - SizeY) / 2;
LTP_DrawPrevNext(RPort,ImageType == IMAGECLASS_PREVIOUS,Left,Top,SizeX,SizeY);
break;
case IMAGECLASS_EJECT:
Left = Left + (Width - SizeX) / 2;
Top = Top + (Height - SizeY) / 2;
LTP_DrawPicker(RPort,TRUE,Left,Top,SizeX,SizeY);
break;
case IMAGECLASS_RECORD:
LTP_RenderCircle(RPort,Left + Width / 2,Top + Height / 2,SizeY / 2,AspectX,AspectY);
break;
case IMAGECLASS_PLAY:
case IMAGECLASS_REWIND:
Left = Left + (Width - SizeX) / 2;
Top = Top + (Height - SizeY) / 2;
LTP_RenderArrow(RPort,ImageType == IMAGECLASS_REWIND,Left,Top,SizeX,SizeY);
break;
case IMAGECLASS_STOP:
Left = Left + (Width - SizeX) / 2;
Top = Top + (Height - SizeY) / 2;
RectFill(RPort,Left,Top,Left + SizeX - 1,Top + SizeY - 1);
break;
case IMAGECLASS_PAUSE:
Left = Left + (Width - SizeX) / 2;
Top = Top + (Height - SizeY) / 2;
RectFill(RPort,Left,Top,Left + SizeX - 1,Top + SizeY - 1);
Size = SizeX - (2 * SizeX) / 3;
Mid = SizeX / 3;
LTP_SetAPen(RPort,Background);
RectFill(RPort,Left + Mid,Top,Left + Mid + Size - 1,Top + SizeY - 1);
break;
}
}
}
#endif /* DO_TAPEDECK_KIND */